get custom field

108

get custom field -

/* put this code in home.php file create in child theme  */

<?php 
 /*Template Name: Home Template*/
 
echo get_post_meta($post->ID, 'Name', true); 
  
?>
 /* Or use this code  */
 <?php 
	$value =get_field('Name');
	echo $value;
?>

how to get all post fields in wordpress -

echo '<pre>';
print_r(get_post_custom($post_id));
echo '</pre>';

Comments

Submit
0 Comments